/**
 * @fileOverview orbit
 * @author huangtonger@aliyun.com
 */
const OrbitController = require('../controller/orbit');
const Mixin = {};

Mixin.CFG = {
  /**
   * @type {object}
   */
  orbit: null
};

Mixin.INIT = '_initOrbit';
Mixin.AUGMENT = {
  _initOrbit() {
    const orbitCfg = this.get('orbit');
    if (orbitCfg) {
      const orbitController = new OrbitController({
        diagram: this,
        ...orbitCfg
      });
      this.setController('orbit', orbitController);
    }
  },
  showOrbit(item) {
    const orbitController = this.getController('orbit');
    orbitController.show(item);
  },
  hideOrbit() {
    const orbitController = this.getController('orbit');
    orbitController.hide();
  },
  layoutOrbit(item, point) {
    const orbitController = this.getController('orbit');
    orbitController.layout(item, point);
  }
};
module.exports = Mixin;
